{extend name="layout/common_layout" /}
{block name="css"}
<style>
        .layui-inline {margin-left:15px;}
</style>
{/block}
{block name="body"}
    <!--tab标签-->
<div class="layui-tab layui-tab-brief">
        <ul class="layui-tab-title">
            <li class="layui-this">会员充值列表</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form layui-form-pane" action="{:url('admin/userviplog/index')}" method="get">
                    <div class="layui-inline">
                        <label class="layui-form-label">关键词</label>
                        <div class="layui-input-inline">
                            <input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn">搜索</button>
                    </div>
                </form>
                <hr>
                 <form action="" method="post" class="ajax-form">
                    <button type="button" class="layui-btn layui-btn-small ajax-action" data-action="{:url('admin/userviplog/toggle',['type'=>'done_select'])}">结算选择</button>
                    <button type="button" class="layui-btn layui-btn-warm layui-btn-small ajax-action" data-action="{:url('admin/userviplog/toggle',['type'=>'done_all'])}">结算全部</button>
                    <div class="layui-inline">总金额：{$money_count.count_all}</div>
                    <div class="layui-inline" style="color:#FF5722">未结算金额：<b>{$money_count.nodone_pay}</b></div>
                    <div class="layui-inline" style="color:#FFB800">已结算金额：{$money_count.done_pay}</div>
                    <div class="layui-inline">总支付代理金额：{$money_count.agent_all_pay}</div>
                    <div class="layui-inline" style="color:#2F4056">未结算代理金额：{$money_count.agent_nodone}</div>
                    <div class="layui-tab-item layui-show">
                        <table class="layui-table">
                    <thead>
                    <tr>
                        <th style="width: 15px;"><input type="checkbox" class="check-all"></th>
                        <th style="width: 30px;">ID</th>
                        <th>用户名</th>
                        <th>手机</th>
                        <th>充值金额</th>
                        <th>是否已成永久vip</th>
                        <th>充值时间</th>
                        <th>续费类型</th>
                        <th>vip到期时间</th>
                        <th>是否有代理</th>
                        <th>是否已结算</th>
                        <th>操作员</th>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach name="list" item="vo"}
                    <tr>
                        <td><input type="checkbox" name="ids[]" value="{$vo.id}"></td>
                        <td>{$vo.id}</td>
                        <td>
                            {notempty name="vo.qq_openid"}
                            <img src="__ROOT__/uploads/images/qq_on.png" />
                            {else/}
                            <img src="__ROOT__/uploads/images/qq_off.png" />
                            {/notempty}
                            {$vo.username}
                        </td>
                        <td>{$vo.mobile}</td>
                        <td>{$vo.money}</td>
                        <td>{php}echo $vo['isevervip']==1 ? '是' : '否';{/php}</td>
                        <td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
                        <td>{php} if($vo['pay_type']==-1) echo '永久会员'; else echo $vo['paytypename'];{/php}
                        </td>
                         <td>{php} if($vo['isevervip']==0) echo date('Y-m-d H:i:s',$vo['enddate']);else echo '无限';{/php}</td>
                         <td class='agent_more'>
                             {if condition="$vo['agentid'] gt 0"}
                                <i class="layui-icon agent_detail">&#xe605;</i>
                                <div class="layui-more-tip" style="display: none;" >
                                       <ul class="layer_notice layui-layer-wrap" style="display: block;">
                                           <li>代理用户：{$vo.agent_name}</li>
                                           <li>代理结算金额：{$vo.agent_pay}</li>
                                       </ul>
                               </div>
                             {/if}   
                         </td>
                        <td>
                            {php}echo $vo['isdone']==1 ? '<b style="color:#78BA32">是</b>' : '否';{/php}
                        </td>
                        <td>
                            {if condition="$vo['isdone']"}{$vo.admin_name}{/if}
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
                         <!--分页-->
                {$user_list->render()}
                    </div>
                 </form>
                
               
            </div>
        </div>
</div>
{/block}
{block name="script"}
<script>
    $(function(){
        $('.agent_more .agent_detail').on('mouseover',function(){
           layer.tips($(this).parents('.agent_more').find('.layui-more-tip').html(), $(this), {
            tips: [4, '#78BA32'],
            area: ['300px', 'auto'],
            time: 4000
           }); 
        });
    });
</script>
{/block}